/**
 * [myAnimate 自定义动画函数]
 * @参数1  {[对象]} 	element       	[要执行动画的元素]
 * @参数2  {[字符串]} 	styleProperty 	[要执行动画的样式属性]
 * @参数3  {[字符串]} 	unit          	[单位]
 * @参数4  {[数值]} 	begin         	[起始位置]
 * @参数5  {[数值]} 	end           	[结束位置]
 * @参数6  {[数值]} 	duration      	[总用时，毫秒]
 * @参数7  {[函数]} 	easeFn        	[缓动类型名称]
 * @返回值 {[未定义]} 					[不返回特定值]
 */
function myAnimate(element,styleProperty,unit,begin,end,duration,easeFn) {
	if (element.isAnimating) {return;}
	element.isAnimating = true;

	var t = 0;
	var delay = 10;
	var cover = end - begin;
	var timer = null;

	function move() {
		if (timer) {clearTimeout(timer);}
		t += delay;

		var newStyle = easeFn(t,begin,cover,duration);
		if (t >= duration) {
			clearTimeout(timer);
			element.isAnimating = false;
			element.style[styleProperty] = end + unit;
			move = null;
		} else {
			element.style[styleProperty] = newStyle + unit;
		}

		timer = setTimeout(move,delay);
	}

	move();
}